<?php
/*
 * This file is part of the BooXtore Student project.
 *
 * (c) Francis Backeland f.backeland@gmail.com
 * (c) Laurine Chaplot chaplot.laurine@orange.fr
 * (c) Julien Dutot julien.dutot@gmail.com
 * (c) Romain Guillaume romain-guillaume@orange.fr
 * (c) Guillaume Paringaux g.paringaux@gmail.com
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code
 */

namespace BXTR\AdminBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;

/**
 * Provide an interface between php and javascripy by generating a .js file
 * containing the configurations using Twig.
 */
class JsConfigController extends Controller
{
    /**
     * Display the script file.
     */
    public function jsConfigAction()
    {
         $rendered = $this->renderView('BXTRAdminBundle:Js:JsConfig.js.twig');
         $response = new Response($rendered);
         $response->headers->set('Content-Type', 'text/javascript');

         return $response;
    }
};
